<template>
<!--  首页-商品列表-->
  <div class="goods">
    <goods-list-item v-for="item in goods" :goods-item="item"/>
<!--il>li{商品列表$}*10-->

  </div>
</template>

<script>
  import GoodsListItem from './GoodsListItem'

  export default {
    name: "GoodsList",
    components: {
      GoodsListItem
    },
    props: {
      goods: {
        type: Array,
        default() {
          return []
        }
      }
    },
    mounted() {
      console.log(this.goods);
    }

  }
</script>

<style scoped>
  .goods {
    display: flex;
/*设置弹性盒子是否换行，默认nowrap不换行，元素全部堆在一行，wrap则根据元素宽度进行换行*/
/*    注意要设置goods-item的宽度*/
    flex-wrap: wrap;
    /*设置元素均等分*/
    justify-content: space-around;

    padding: 2px;
  }


</style>
